﻿using JshRCSWebApi.Infrastructure.Domain.DTO.SysService;

namespace JshRCSWebApi.API.Controllers.SysService
{
    public class LogController : BaseController
    {

        private readonly LogService _logService;
        public LogController(IHttpContextAccessor httpContextAccessor, LogService logService) : base(httpContextAccessor)
        {
            _logService = logService;
        }

       /// <summary>
       /// 获取日志集合
       /// </summary>
       /// <param name="searchDTO"></param>
       /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> GetLogList([FromBody] LogSearchDTO searchDTO)
            => await Task.Run(async () => await _logService.GetLogList(searchDTO));

        /// <summary>
        /// 删除日志
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [HttpDelete]
        public async Task<ApiResult> DeleteLog(int ID)
            => await Task.Run(async () => await _logService.DeleteLog(ID));






    }
}
